package org.fastmvc.ioc.dto;

/**
 * <类描述>
 *
 * @author tangch
 * @date 2017年11月07日 16:34
 */
public class Results<T> {

	protected boolean isSuccess;

	protected T data;

	protected String message;

	protected Object extend;

	public static <D>  Results<D> newResults(boolean isSuccess){
		return newResults(isSuccess,null);
	}

	public static <D> Results<D> newResults(boolean isSuccess,D data){
		return new Results<D>(isSuccess,data,null,null);
	}

	public Results(boolean isSuccess, T data, String message, Object extend) {
		this.isSuccess = isSuccess;
		this.data = data;
		this.message = message;
		this.extend = extend;
	}

	public boolean isSuccess() {
		return isSuccess;
	}

	public void setSuccess(boolean success) {
		isSuccess = success;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getExtend() {
		return extend;
	}

	public void setExtend(Object extend) {
		this.extend = extend;
	}
}
